aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/app/dashboard/lists/[listId]
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-02 14:23:46 +0000
committerMohamedBassem <me@mbassem.com>2024-03-02 14:23:46 +0000
commitcd623ad9d6281389b0a092520c777567fcf5464b (patch)
tree33af8f21d741ed6455ad4b90944c272a99fdd58c /packages/web/app/dashboard/lists/[listId]
parenteeae96553c204097dec8a3c35d86533b3ce055d9 (diff)
downloadkarakeep-cd623ad9d6281389b0a092520c777567fcf5464b.tar.zst
feature: Add an 'All Lists' page
Diffstat (limited to 'packages/web/app/dashboard/lists/[listId]')
-rw-r--r--packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx3
-rw-r--r--packages/web/app/dashboard/lists/[listId]/components/ListView.tsx12
-rw-r--r--packages/web/app/dashboard/lists/[listId]/page.tsx14
3 files changed, 16 insertions, 13 deletions
diff --git a/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx b/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx
index 8961b2d0..32a7facf 100644
--- a/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx
+++ b/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx
@@ -1,9 +1,10 @@
+"use client";
+
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogClose,
DialogContent,
- DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
diff --git a/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx b/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx
index c3d49b6a..6489e9f0 100644
--- a/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx
+++ b/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx
@@ -4,7 +4,6 @@ import BookmarksGrid from "@/app/dashboard/bookmarks/components/BookmarksGrid";
import { ZBookmark } from "@/lib/types/api/bookmarks";
import { ZBookmarkListWithBookmarks } from "@/lib/types/api/lists";
import { api } from "@/lib/trpc";
-import DeleteListButton from "./DeleteListButton";
export default function ListView({
bookmarks,
@@ -21,15 +20,6 @@ export default function ListView({
);
return (
- <div className="container flex flex-col gap-3">
- <div className="flex justify-between">
- <span className="pt-4 text-2xl">
- {data.icon} {data.name}
- </span>
- <DeleteListButton list={data} />
- </div>
- <hr />
- <BookmarksGrid query={{ ids: data.bookmarks }} bookmarks={bookmarks} />
- </div>
+ <BookmarksGrid query={{ ids: data.bookmarks }} bookmarks={bookmarks} />
);
}
diff --git a/packages/web/app/dashboard/lists/[listId]/page.tsx b/packages/web/app/dashboard/lists/[listId]/page.tsx
index b8ca79c3..397a0f1e 100644
--- a/packages/web/app/dashboard/lists/[listId]/page.tsx
+++ b/packages/web/app/dashboard/lists/[listId]/page.tsx
@@ -3,6 +3,7 @@ import { getServerAuthSession } from "@/server/auth";
import { TRPCError } from "@trpc/server";
import { notFound, redirect } from "next/navigation";
import ListView from "./components/ListView";
+import DeleteListButton from "./components/DeleteListButton";
export default async function ListPage({
params,
@@ -28,5 +29,16 @@ export default async function ListPage({
const bookmarks = await api.bookmarks.getBookmarks({ ids: list.bookmarks });
- return <ListView list={list} bookmarks={bookmarks.bookmarks} />;
+ return (
+ <div className="container flex flex-col gap-3">
+ <div className="flex justify-between">
+ <span className="pt-4 text-2xl">
+ {list.icon} {list.name}
+ </span>
+ <DeleteListButton list={list} />
+ </div>
+ <hr />
+ <ListView list={list} bookmarks={bookmarks.bookmarks} />
+ </div>
+ );
}